import request from '@/utils/request'

// user
export const getUser = username => {
  return request({
    url: '/user',
    method: 'get',
    params: { username }
  })
}

/**
 * 登录
 * @param {string} username
 * @param {string} passwd
 * @returns {Promise}
 */
export const login = data => {
  return request({
    url: '/login',
    method: 'post',
    data
  })
}

/**
 * 注册
 * @param {string} username
 * @param {string} passwd
 * @returns {Promise}
 */
export const signup = data => {
  return request({
    url: '/signup',
    method: 'post',
    data
  })
}
